/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package orm;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class PreguntaDetachedCriteria extends AbstractORMDetachedCriteria {
	public final BooleanExpression respuesta;
	public final StringExpression descripPreg;
	
	public PreguntaDetachedCriteria() {
		super(orm.Pregunta.class, orm.PreguntaCriteria.class);
		respuesta = new BooleanExpression("respuesta", this.getDetachedCriteria());
		descripPreg = new StringExpression("descripPreg", this.getDetachedCriteria());
	}
	
	public PreguntaDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, orm.PreguntaCriteria.class);
		respuesta = new BooleanExpression("respuesta", this.getDetachedCriteria());
		descripPreg = new StringExpression("descripPreg", this.getDetachedCriteria());
	}
	
	public EncuestaDetachedCriteria createIdPreguntaCriteria() {
		return new EncuestaDetachedCriteria(createCriteria("ORM_IdPregunta"));
	}
	
	public Pregunta uniquePregunta(PersistentSession session) {
		return (Pregunta) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Pregunta[] listPregunta(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Pregunta[]) list.toArray(new Pregunta[list.size()]);
	}
}

